Add peaks_on_probe widget.#3022
Merged
alejoe91 merged 2 commits intoSpikeInterface:mainfrom Jun 21, 2024
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a 'Peaks on Probe' widget that plots the peak locations overlaid on a plot of the probe (I am not a huge fan of the name myself, feel free to suggest others!). This PR closes #2986.
This plot has come up a few times in documentation and tutorials so I think could be a handy plotting function to have. A nice future addition would be to color-by-unit but if understand correctly from @samuelgarcia this is not currently possible as peaks do not hold unit. For me it is okay to include as-is and refine later if desired, the main reason I would like it is to import and call it from the motion/drift tutorial in #2879.
Overview
The function works by taking two main inputs, pre-calculated 'peaks' and corresponding 'peak_locations'. This can be either a single one of each or a list of corresponding entries. If multiple peaks / peak locations are passed, they are plot on different column axes of the same plot.
It is optional to select to only plot peaks from a certain segment, or between two times, to restrict the y-axis limits and to handle how peaks are decimated before plotting.
Questions
I think I might be using
make_mpl_figure()wrong, I am performing 1 index operation to move theAxesobjects to a 1d array here. Is this okay?